package cn.jiyun.service.impl;

import cn.jiyun.mapper.FfwMapper;
import cn.jiyun.pojo.Ffw;
import cn.jiyun.service.FfwService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class FfwServiceImpl extends ServiceImpl<FfwMapper, Ffw> implements FfwService {
    @Autowired
    private FfwMapper ffwMapper;

    @Override
    public Page findPage1(Integer pageNum, Integer pageSize, Ffw ffw) {
        Page<Ffw> page = new Page<>(pageNum,pageSize);
        LambdaQueryWrapper<Ffw> qr = new LambdaQueryWrapper<>();
        qr.like(ffw.getName()!=null,Ffw::getName,ffw.getName());
        Page page1=baseMapper.selectPage(page,qr);
        return page1;
    }
}
